home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5351 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.0 KB

  1. Path: dyn010.king-george.va.us.crosslink.net!miller
  2. From: miller@crosslink.net (Randall Miller)
  3. Newsgroups: comp.lang.c++
  4. Subject: Question on char to int and back
  5. Date: Sat, 3 Feb 1996 21:23:18 UNDEFINED
  6. Organization: CrossLink Internet Services
  7. Message-ID: <miller.1.00C350A1@crosslink.net>
  8. NNTP-Posting-Host: dyn010.king-george.va.us.crosslink.net
  9. X-Newsreader: Trumpet for Windows [Version 1.0 Rev B final beta #1]
  10.  
  11. This might seem like a trivial question but I would like to know how I can go
  12. from reading in a char, placing it in a stack of int (ie)
  13.         char c; 
  14.         c = cin.get()
  15.         push(s,c);
  16.         now if the char was a '+', it would be entered into the stack as 43.
  17.         I know that a cout.put(c) will output it as a character but if I want 
  18.         to pop it from the stack and act on it as a character how do I
  19.         convert it back to a character?
  20.    
  21.                           I would be greatful for any help
  22.                          
  23.                                                         Randy 
  24.